package org.zjt.spring.batch;
import org.springframework.batch.item.file.LineMapper;

/**
 * @author <a href="juntao.zhang@qq.com">juntao.zhang</a>
 * @Description:
 * @Package org.zjt.spring.batch
 * @date 2018/5/9 12:00
 * @see
 */
public class HelloLineMapper implements LineMapper<DeviceCommand> {

    @Override
    public DeviceCommand mapLine(String line, int lineNumber) throws Exception {

        String[] args = line.split(",");
        DeviceCommand deviceCommand = new DeviceCommand();
        deviceCommand.setId(args[0]);
        deviceCommand.setStatus(args[1]);
        return deviceCommand;

    }

}
